﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace CluelessGame
{
    /// <summary>
    /// Interaction logic for ChangeNameScreen.xaml
    /// </summary>
    public partial class ChangeNameScreen : Window
    {
        public bool Canceled = false;

        public string Text
        {
            get { return nameTextBox.Text; } 
        }

        public ChangeNameScreen()
        {
            InitializeComponent();
            nameTextBox.Focus();
        }

        private void buttonOK_Click(object sender, RoutedEventArgs e)
        {
            Close();
        }

        private void buttonCancel_Click(object sender, RoutedEventArgs e)
        {
            Canceled = true;
            Close();
        }

        public static string GetName()
        {
            ChangeNameScreen changeNameScreen = new ChangeNameScreen();
            changeNameScreen.ShowDialog();

            if (changeNameScreen.Canceled)
            {
                return null;
            }

            return changeNameScreen.Text;
        }
    }
}
